package com.mb.common.utils;

import org.apache.commons.codec.binary.Base64;
/**
 * base64 编码、解码
 *
 * @author michael.li
 * @create 2018-03-24 下午3:08
 **/
public class Base64Utils {

    /**
     * 编码
     * @param parms
     * @return
     */
    public static String encode(String parms){
        return Base64.encodeBase64String(parms.getBytes());
    }

    /**
     * 解码
     * @param parms
     * @return
     */
    public static String decode(String parms){
        byte [] bytes =  Base64.decodeBase64(parms);
        return new String(bytes);
    }


}
